Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: WIZnetInterface SNTPClinet mbed-dev
Prerequisite
This example is to obtain a time from NTP server using SNTP protocol.
To implement this function, you need a Platform board and OLED.
Below are what we used.
- WIZwiki-W7500 from WIZnet (Platform board)
- OLED from WIZnet
Hardware Configuration
WIZwiki-W7500 Pin map

OLED (from WIZnet)
Wiring Table
| OLED | W7500 |
| SCL | PA_9 |
| SDA | PA_10 |
| GND | GND |
| VCC | VCC |
Software
Define Pins
SSD1306.h
#if defined(TARGET_WIZwiki_W7500) #define SDA PA_10 #define SCL PA_9 #endif
Connect to NTP server
main.cpp
SNTPClient sntp("time.nist.gov", 40); // timezone: Korea, Republic of
sntp.connect();
Get Time
main.cpp
if(sntp.getTime(&ntptime) == true)
{
pc.printf("%d-%d-%d, %d:%d:%d\r\n", ntptime.yy, ntptime.mo, ntptime.dd, ntptime.hh, ntptime.mm, ntptime.ss);
wait(1.0);
}
else
{
while(sntp.getTime(&ntptime) != true)
{
//break;
}
}
Caution
watchout pins setting
An error occurred while processing your request
no such method: %7Dshortlog